package com.mk.common;

/**
 * Created by yanzhiping on 2017/8/8.
 */
public class Config {
    public static final boolean DEBUG = true;

    public static final String PASSWORD_INIT = "123456";//普通人员初始密码

    public static final String EXPIRE_TIME = "2018-04-01 00:00:00";//过期时间

    public interface ABLE_CONFIG{
        Integer ABLE = 0;
        Integer UNABLE = 1;
        String ABLE_COLUMN = "is_deleted";
    }

    public interface FIXED_CONFIG{
        Integer FIXED = 1;
        Integer UNFIXED = 0;
        String FIXED_COLUMN = "is_fixed";
    }

    /**
     * 返回值 1操作成功  0不成功
     */
    public interface RETURN_VALUE{
        Integer SUCCESS = 1;
        Integer FAIL = 0;
    }

    /**
     *定位相关
     */
    /**
     * 缓存过期时间10秒
     */
    private static final int LOCATION_EXPIRED = 10000;
    private static final int PUSHRETRY_EXPIRED = 1000 * 60 * 60 * 24;

    private static final int WARNING_EXPIRED = 1000*60*5;//5分钟

    public static final int RSSI_MIN = -90;
    public static final int RSSI_MAX = 40;

    public static final WIFI_BEACON LOCATION_TYPE = WIFI_BEACON.WIFI;
    public static final KIS LOCATION_KIS = KIS.ONE;

    public enum WIFI_BEACON{
        WIFI,BEACON;
    }

    public enum KIS{
        ONE,THREE;
    }

    public static long CACHE_EXPIRED(){
        return System.currentTimeMillis()+LOCATION_EXPIRED;
    }

    public static long PUSHRETRY_EXPIRED(){
        return System.currentTimeMillis()+PUSHRETRY_EXPIRED;
    }

    public static long WARNING_EXPIRED(){
        return System.currentTimeMillis()+WARNING_EXPIRED;
    }

    public static boolean validRssi(byte rssi){
        if (rssi < RSSI_MIN || rssi >RSSI_MAX)
            return false;
        else
            return true;
    }
}
